<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class FileManager</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class FileManager</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">FileManager</p>
<p class="description"><p>this class will be used for manipulation of files  in the user files directory</p></p>
		<p class="notes">
			Located in <a class="field" href="__inc---class---FileManager.php.html">/_inc/class/FileManager.php</a> (line <span class="field">100</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																				<div class="method-definition">
					static 						<span class="method-result">instance</span>
										<a href="#getInstance" title="details" class="method-name">getInstance</a>
										()
									</div>
																																																																																
												<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#addDir" title="details" class="method-name">addDir</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$perm</span> = <span class="var-default">array( )</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$public</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#addFile" title="details" class="method-name">addFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$contents</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$perm</span> = <span class="var-default">array( )</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$public</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#cleanUp" title="details" class="method-name">cleanUp</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#copyFile" title="details" class="method-name">copyFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#error" title="details" class="method-name">error</a>
										()
									</div>
																								<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#hasPerm" title="details" class="method-name">hasPerm</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$rw</span> = <span class="var-default">'r'</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">false</span>], <span class="var-type">string/int</span>&nbsp;<span class="var-name">$file</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#moveDir" title="details" class="method-name">moveDir</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$dest</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#moveFile" title="details" class="method-name">moveFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#moveUploadedFile" title="details" class="method-name">moveUploadedFile</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$file</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#readDir" title="details" class="method-name">readDir</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">int/bool</span>&nbsp;<span class="var-name">$level</span> = <span class="var-default">1</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$strict</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string/bool</span>
										<a href="#readFile" title="details" class="method-name">readFile</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#removeDir" title="details" class="method-name">removeDir</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#unzip" title="details" class="method-name">unzip</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$zip</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#zip" title="details" class="method-name">zip</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$zip</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method getInstance</span> (line <span class="line-number">463</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">getInstance</p>
<p class="description"><p>if an instance exists, it returns it,  if not, it creates a new one and returns  it</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result">instance</span>
		<span class="method-name">
			getInstance
		</span>
				()
			</div>
	
		
			
	</div>

<a name="methodaddDir" id="addDir"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">addDir</span> (line <span class="line-number">483</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">addDir</p>
<p class="description"><p>adds a directory to the file manager</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			addDir
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$perm</span> = <span class="var-default">array( )</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$public</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$perm</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$public</span>			</li>
				</ul>
		
			
	</div>
<a name="methodaddFile" id="addFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">addFile</span> (line <span class="line-number">608</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">addFile</p>
<p class="description"><p>creates a file at the given location. returns  false if permission failure</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			addFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$contents</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$perm</span> = <span class="var-default">array( )</span>], [<span class="var-type"></span>&nbsp;<span class="var-name">$public</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$contents</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$perm</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$public</span>			</li>
				</ul>
		
			
	</div>
<a name="methodcleanUp" id="cleanUp"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">cleanUp</span> (line <span class="line-number">784</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">cleanUp</p>
<p class="description"><p>scans the files directory for files which are not in  the database and removes them. it is rare for any files  to be in this directory without being in the database,  with the exception of when a database query fails.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			cleanUp
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodcopyFile" id="copyFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">copyFile</span> (line <span class="line-number">693</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">copyFile</p>
<p class="description"><p>copys a file from one location to another. returns  an array of new database info on the file</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			copyFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$file</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methoderror" id="error"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">error</span> (line <span class="line-number">769</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">error</p>
<p class="description"><p>returns information on the last recorded error.  for the form of the array, see the private error  variable</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			error
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodhasPerm" id="hasPerm"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">hasPerm</span> (line <span class="line-number">276</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">hasPerm</p>
<p class="description"><p>checks if a user has permission to read/write  a file in the user files directory.</p><p>$rw defines what permissions are being checked  and must be one of or a combination of (such as  rw or wv) the following:  r - read  w - write  v - view (checks if the file is public/private)</p><p>checks can be performed on a specific user using  $id, defaults to current user</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			hasPerm
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$rw</span> = <span class="var-default">'r'</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">false</span>], <span class="var-type">string/int</span>&nbsp;<span class="var-name">$file</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string/int</span>
				<span class="var-name">$file</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$rw</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodmoveDir" id="moveDir"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">moveDir</span> (line <span class="line-number">742</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			moveDir
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$dest</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$dest</span>			</li>
				</ul>
		
			
	</div>
<a name="methodmoveFile" id="moveFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">moveFile</span> (line <span class="line-number">656</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">moveFile</p>
<p class="description"><p>moves a file from one location to another  while keeping the database in sync</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			moveFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$file</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$file</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodmoveUploadedFile" id="moveUploadedFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">moveUploadedFile</span> (line <span class="line-number">746</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			moveUploadedFile
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$file</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$file</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreadDir" id="readDir"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">readDir</span> (line <span class="line-number">585</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">readDir</p>
<p class="description"><p>reads a directory and returns it's contents. if $all  is true then all directory and sub directory contents  are returned. if strict is true then will return false  if permission is denied to read any file</p><p>$level	-	can be an integer of how many levels 			of directories to read or true to read 			all levels. reads one level by default  $strict	-	if strict is true and any files fail to 			be read the method will generate an error 			and return false, otherwise those files 			will just be excluded from the list</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			readDir
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>, [<span class="var-type">int/bool</span>&nbsp;<span class="var-name">$level</span> = <span class="var-default">1</span>], [<span class="var-type">bool</span>&nbsp;<span class="var-name">$strict</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
					<li>
				<span class="var-type">int/bool</span>
				<span class="var-name">$level</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$strict</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreadFile" id="readFile"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">readFile</span> (line <span class="line-number">728</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">readFile</p>
<p class="description"><p>returns the contents of a file</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string/bool</span>
		<span class="method-name">
			readFile
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodremoveDir" id="removeDir"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">removeDir</span> (line <span class="line-number">536</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">removeDir</p>
<p class="description"><p>removes a directory, and all of it's contents if  non-empty. must have permission to remove all files in  directory</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			removeDir
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodunzip" id="unzip"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">unzip</span> (line <span class="line-number">755</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			unzip
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$zip</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$zip</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
<a name="methodzip" id="zip"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">zip</span> (line <span class="line-number">751</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			zip
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$zip</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$zip</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$path</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Thu, 07 Jun 2012 18:22:46 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.4</a>
	</p>
	</div></body>
</html>